<?php
class benutzerUI extends mainGUI {
	const templatename = "benutzer";
	const jsfile = "benutzerUI.js";
	
	function addHead() {
		$ausgabe = "<script type='text/JavaScript' src='".settings::templatepfad.self::templatename."/".self::jsfile."'></script>";
		return $ausgabe;
	}
	
	function registerForm($action="") {
		if ($action == "") $action = $_SERVER['PHP_SELF'];
		
		$ausgabe = "<form name='register' method='post' action='".$action."'>";
		$ausgabe .= "<script type='text/JavaScript'>
						var lang_form_checkpw_veryweak = '".Language::LANG_FORM_CHECKPW_VERYWEAK."';
						var lang_form_checkpw_weak = '".Language::LANG_FORM_CHECKPW_WEAK."';
						var lang_form_checkpw_mediocre = '".Language::LANG_FORM_CHECKPW_MEDIOCRE."';
						var lang_form_checkpw_strong = '".Language::LANG_FORM_CHECKPW_STRONG."';
						var lang_form_checkpw_verystrong = '".Language::LANG_FORM_CHECKPW_VERYSTRONG."';
					</script>";
		
		$inhalt[0][0] = Language::LANG_FORM_USERNAME;
		$inhalt[0][1] = "<input type='text' name='regBenutzer' onkeyup='checkinput(\"document.register.regBenutzer\");'>";
		$inhalt[0][2] = "<input type='text' name='regBenutzerstatus'>";
		$inhalt[1][0] = Language::LANG_FORM_PASSWORD;
		$inhalt[1][1] = "<input type='password' name='regPasswort' onkeyup='checkpasswort(\"document.register.regPasswort\");'>";
		$inhalt[1][2] = "<input type='text' name='regPasswortstatus'>";
		$inhalt[2][0] = Language::LANG_FORM_CONFIRMATION;
		$inhalt[2][1] = "<input type='password' name='regpwconfirm' onkeyup='comparepw(\"document.register.regpwconfirm\",\"document.register.regPasswort\");'>";
		$inhalt[2][2] = "<input type='text' name='regpwconfirmstatus'>";
		$inhalt[3][0] = "E-Mail";
		$inhalt[3][1] = $this->showBox("regEmail","text");
		$inhalt[4][0] = "";
		$inhalt[4][1] = $this->showSubmitLink(Language::LANG_FORM_REGISTER,"register");
		$ausgabe .= $this->showTable($inhalt);
		
		$ausgabe .= "</form>";
		return $ausgabe;
	}
	
	function loginForm($action="") {
		if ($action == "") $action = $_SERVER['PHP_SELF'];
		
		$ausgabe = "<form name='login' method='post' action='".$action."'>";
		
		$inhalt[0][0] = Language::LANG_FORM_USERNAME;
		$inhalt[0][1] = $this->showBox("btnbenutzer","text");
		$inhalt[1][0] = Language::LANG_FORM_PASSWORD;
		$inhalt[1][1] = $this->showBox("btnpasswort","password");
		$inhalt[2][0] = "";
		$inhalt[2][1] = $this->showSubmitLink(Language::LANG_FORM_LOGIN,"login");
		$ausgabe .= $this->showTable($inhalt);
		
		$ausgabe .= "</form>";
		return $ausgabe;
	}
}
?>